
#pragma once

#include <array>
#include <boost/asio.hpp>
#include <boost/asio/detail/cstdint.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/system/errc.hpp>
#include <cstdint>
#include <vector>
#include "http_request_response.h"

using namespace	boost::asio;

class HttpServer;

class Session
{
public:
	Session(io_context & io_context, HttpServer * http_server, ip::tcp::socket & m_socket, int64_t id);
	void StartSession();
	void ProcessRequestData();
	void CloseSocket();
private:
	std::array<char, 128> m_read_buffer;
	std::vector<char>     m_data_buffer;
	HttpRequestParam      m_http_request_param;
private:
	io_context & m_context;
	HttpServer * m_http_server;
	int64_t         m_id{0};
	ip::tcp::socket m_socket;
};